/******************************************************************************
 * FILENAME    : DBFM.H
 * PRODUCT    : SoftPay ASPAC Base Application
 * VERSION     : 1.0
 * MODULE      : Data Base Module
 * AUTHOR(S)  : Vipin_k1
 * CREATED     : 19-Jul-2000
 *
 * DESCRIPTION : This file shoudl be included by the modules which wish to
 *               utilise the Data Base Module.
 *
 * NOTES       :
 *
 * CONTENTS    :
 *
 *
 * MODIFICATION HISTORY    :
 *
 * #  Date       Who        History
 * -- --------   ---------- ---------------------------------------
 *
 *******************************************************************************
 * Copyright (C) 2000 by VeriFone Inc.
 * All rights reserved. No part of this software may be reproduced,transmitted,
 * transcribed, stored in a retrieval system, or translated into any language
 * or computer language, in any form or by any means, electronic, mechanical,
 * magnetic, optical, chemical, manual or otherwise, without the prior written
 * permission of VeriFone Inc.
 *                                                VeriFone Inc.
 *                                                III Lagoon Drive, Suite 400
 *                                                Redwood City, CA 94065
 ******************************************************************************
 */

#ifndef DBFM_DEFINED
#define DBFM_DEFINED

#define DB_REC_SIZE               SIZE_UINT
#define DB_HDR_SIZE         (2 * SIZE_UINT)

#define DB_APPENDREC                 (-100)

/* Error Numbers used in the DBFM module */
#define DB_OPEN_ERR                   (-6001)
#define DB_CREAT_ERR                 (-6002)
#define DB_CLOSE_ERR                 (-6003)
#define DB_READ_ERR                   (-6004)
#define DB_WRITE_ERR                 (-6005)
#define DB_SEEK_ERR                    (-6006)
#define DB_INV_FILE                     (-6007)
#define DB_INV_REC_SIZE             (-6008)
#define DB_REC_NOEXIST              (-6009)
#define DB_INV_INPUT                  (-6010)
#define DB_FILE_EMPTY                (-6011)

/* Function Prototypes */
extern int inDBFileExists(const char* pszFileName);
extern int inDBRemoveFile(const char* pszFileName);
extern int inDBTotalRecords(const char* pszFileName);
extern int inDBDeleteRecord(const char* pszFileName,unsigned int uiRecNum);
extern int inDBCreateFile(const char* pszFileName,unsigned int uiRecordSize);
extern int inDBWriteRecord(const char* pszFileName,int inRecNum,const unsigned char* pucBuf);
extern int inDBReadRecord(const char* pszFileName,unsigned int uiRecNum,unsigned char* pucBuf);

extern int inDBReadNRecords(const char* pszFileName,unsigned int uiStartRecNum,unsigned int uiNumOfRecs,unsigned char* pucDatBuf);

#endif /*  DBFM_H */

